3.66 \(\int (c+d \tan (e+f x))^3 (A+B \tan (e+f x)+C \tan ^2(e+f x)) \, dx\)
Optimal. Leaf size=191 \[ \frac {d \tan (e+f x) \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )}{f}-\frac {\left (d (A-C) \left (3 c^2-d^2\right )+B \left (c^3-3 c d^2\right )\right ) \log (\cos (e+f x))}{f}-x \left (-A \left (c^3-3 c d^2\right )+3 B c^2 d-B d^3+c^3 C-3 c C d^2\right )+\frac {(d (A-C)+B c) (c+d \tan (e+f x))^2}{2 f}+\frac {B (c+d \tan (e+f x))^3}{3 f}+\frac {C (c+d \tan (e+f x))^4}{4 d f} \]
[Out]
-(c^3*C+3*B*c^2*d-3*c*C*d^2-B*d^3-A*(c^3-3*c*d^2))*x-((A-C)*d*(3*c^2-d^2)+B*(c^3-3*c*d^2))*ln(cos(f*x+e))/f+d*
(2*c*(A-C)*d+B*(c^2-d^2))*tan(f*x+e)/f+1/2*(B*c+(A-C)*d)*(c+d*tan(f*x+e))^2/f+1/3*B*(c+d*tan(f*x+e))^3/f+1/4*C
*(c+d*tan(f*x+e))^4/d/f
________________________________________________________________________________________
Rubi [A] time = 0.24, antiderivative size = 191, normalized size of antiderivative = 1.00,
number of steps used = 5, number of rules used = 4, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.121, Rules used =
{3630, 3528, 3525, 3475} \[ \frac {d \tan (e+f x) \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )}{f}-\frac {\left (d (A-C) \left (3 c^2-d^2\right )+B \left (c^3-3 c d^2\right )\right ) \log (\cos (e+f x))}{f}-x \left (-A \left (c^3-3 c d^2\right )+3 B c^2 d-B d^3+c^3 C-3 c C d^2\right )+\frac {(d (A-C)+B c) (c+d \tan (e+f x))^2}{2 f}+\frac {B (c+d \tan (e+f x))^3}{3 f}+\frac {C (c+d \tan (e+f x))^4}{4 d f} \]
Antiderivative was successfully verified.
[In]
Int[(c + d*Tan[e + f*x])^3*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2),x]
[Out]
-((c^3*C + 3*B*c^2*d - 3*c*C*d^2 - B*d^3 - A*(c^3 - 3*c*d^2))*x) - (((A - C)*d*(3*c^2 - d^2) + B*(c^3 - 3*c*d^
2))*Log[Cos[e + f*x]])/f + (d*(2*c*(A - C)*d + B*(c^2 - d^2))*Tan[e + f*x])/f + ((B*c + (A - C)*d)*(c + d*Tan[
e + f*x])^2)/(2*f) + (B*(c + d*Tan[e + f*x])^3)/(3*f) + (C*(c + d*Tan[e + f*x])^4)/(4*d*f)
Rule 3475
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]
Rule 3525
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[(b*d*Tan[e + f*x])/f, x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]
Rule 3528
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(d
*(a + b*Tan[e + f*x])^m)/(f*m), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]
Rule 3630
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> Simp[(C*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Int[(a + b*Tan[e + f*x])
^m*Simp[A - C + B*Tan[e + f*x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0]
&& !LeQ[m, -1]
Rubi steps
\begin {align*} \int (c+d \tan (e+f x))^3 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx &=\frac {C (c+d \tan (e+f x))^4}{4 d f}+\int (A-C+B \tan (e+f x)) (c+d \tan (e+f x))^3 \, dx\\ &=\frac {B (c+d \tan (e+f x))^3}{3 f}+\frac {C (c+d \tan (e+f x))^4}{4 d f}+\int (c+d \tan (e+f x))^2 (A c-c C-B d+(B c+(A-C) d) \tan (e+f x)) \, dx\\ &=\frac {(B c+(A-C) d) (c+d \tan (e+f x))^2}{2 f}+\frac {B (c+d \tan (e+f x))^3}{3 f}+\frac {C (c+d \tan (e+f x))^4}{4 d f}+\int (c+d \tan (e+f x)) \left (-c^2 C-2 B c d+C d^2+A \left (c^2-d^2\right )+\left (2 c (A-C) d+B \left (c^2-d^2\right )\right ) \tan (e+f x)\right ) \, dx\\ &=-\left (c^3 C+3 B c^2 d-3 c C d^2-B d^3-A \left (c^3-3 c d^2\right )\right ) x+\frac {d \left (2 c (A-C) d+B \left (c^2-d^2\right )\right ) \tan (e+f x)}{f}+\frac {(B c+(A-C) d) (c+d \tan (e+f x))^2}{2 f}+\frac {B (c+d \tan (e+f x))^3}{3 f}+\frac {C (c+d \tan (e+f x))^4}{4 d f}+\left ((A-C) d \left (3 c^2-d^2\right )+B \left (c^3-3 c d^2\right )\right ) \int \tan (e+f x) \, dx\\ &=-\left (c^3 C+3 B c^2 d-3 c C d^2-B d^3-A \left (c^3-3 c d^2\right )\right ) x-\frac {\left ((A-C) d \left (3 c^2-d^2\right )+B \left (c^3-3 c d^2\right )\right ) \log (\cos (e+f x))}{f}+\frac {d \left (2 c (A-C) d+B \left (c^2-d^2\right )\right ) \tan (e+f x)}{f}+\frac {(B c+(A-C) d) (c+d \tan (e+f x))^2}{2 f}+\frac {B (c+d \tan (e+f x))^3}{3 f}+\frac {C (c+d \tan (e+f x))^4}{4 d f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 2.44, size = 212, normalized size = 1.11 \[ \frac {-6 (d (C-A)+B c) \left (6 c d^2 \tan (e+f x)+(-d+i c)^3 \log (-\tan (e+f x)+i)-(d+i c)^3 \log (\tan (e+f x)+i)+d^3 \tan ^2(e+f x)\right )+2 B \left (-6 d^2 \left (d^2-6 c^2\right ) \tan (e+f x)+12 c d^3 \tan ^2(e+f x)+3 i (c-i d)^4 \log (\tan (e+f x)+i)-3 i (c+i d)^4 \log (-\tan (e+f x)+i)+2 d^4 \tan ^3(e+f x)\right )+3 C (c+d \tan (e+f x))^4}{12 d f} \]
Antiderivative was successfully verified.
[In]
Integrate[(c + d*Tan[e + f*x])^3*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2),x]
[Out]
(3*C*(c + d*Tan[e + f*x])^4 - 6*(B*c + (-A + C)*d)*((I*c - d)^3*Log[I - Tan[e + f*x]] - (I*c + d)^3*Log[I + Ta
n[e + f*x]] + 6*c*d^2*Tan[e + f*x] + d^3*Tan[e + f*x]^2) + 2*B*((-3*I)*(c + I*d)^4*Log[I - Tan[e + f*x]] + (3*
I)*(c - I*d)^4*Log[I + Tan[e + f*x]] - 6*d^2*(-6*c^2 + d^2)*Tan[e + f*x] + 12*c*d^3*Tan[e + f*x]^2 + 2*d^4*Tan
[e + f*x]^3))/(12*d*f)
________________________________________________________________________________________
fricas [A] time = 1.57, size = 201, normalized size = 1.05 \[ \frac {3 \, C d^{3} \tan \left (f x + e\right )^{4} + 4 \, {\left (3 \, C c d^{2} + B d^{3}\right )} \tan \left (f x + e\right )^{3} + 12 \, {\left ({\left (A - C\right )} c^{3} - 3 \, B c^{2} d - 3 \, {\left (A - C\right )} c d^{2} + B d^{3}\right )} f x + 6 \, {\left (3 \, C c^{2} d + 3 \, B c d^{2} + {\left (A - C\right )} d^{3}\right )} \tan \left (f x + e\right )^{2} - 6 \, {\left (B c^{3} + 3 \, {\left (A - C\right )} c^{2} d - 3 \, B c d^{2} - {\left (A - C\right )} d^{3}\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right ) + 12 \, {\left (C c^{3} + 3 \, B c^{2} d + 3 \, {\left (A - C\right )} c d^{2} - B d^{3}\right )} \tan \left (f x + e\right )}{12 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((c+d*tan(f*x+e))^3*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="fricas")
[Out]
1/12*(3*C*d^3*tan(f*x + e)^4 + 4*(3*C*c*d^2 + B*d^3)*tan(f*x + e)^3 + 12*((A - C)*c^3 - 3*B*c^2*d - 3*(A - C)*
c*d^2 + B*d^3)*f*x + 6*(3*C*c^2*d + 3*B*c*d^2 + (A - C)*d^3)*tan(f*x + e)^2 - 6*(B*c^3 + 3*(A - C)*c^2*d - 3*B
*c*d^2 - (A - C)*d^3)*log(1/(tan(f*x + e)^2 + 1)) + 12*(C*c^3 + 3*B*c^2*d + 3*(A - C)*c*d^2 - B*d^3)*tan(f*x +
e))/f
________________________________________________________________________________________
giac [B] time = 24.81, size = 4300, normalized size = 22.51 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((c+d*tan(f*x+e))^3*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="giac")
[Out]
1/12*(12*A*c^3*f*x*tan(f*x)^4*tan(e)^4 - 12*C*c^3*f*x*tan(f*x)^4*tan(e)^4 - 36*B*c^2*d*f*x*tan(f*x)^4*tan(e)^4
- 36*A*c*d^2*f*x*tan(f*x)^4*tan(e)^4 + 36*C*c*d^2*f*x*tan(f*x)^4*tan(e)^4 + 12*B*d^3*f*x*tan(f*x)^4*tan(e)^4
- 6*B*c^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan
(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 - 18*A*c^2*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + t
an(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 + 18*C*c^2*d*log(
4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(
e)^2 + 1))*tan(f*x)^4*tan(e)^4 + 18*B*c*d^2*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(
e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 + 6*A*d^3*log(4*(tan(f*x)^4*tan
(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*
x)^4*tan(e)^4 - 6*C*d^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 -
2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^4*tan(e)^4 - 48*A*c^3*f*x*tan(f*x)^3*tan(e)^3 + 48*C*c^3*f*x*t
an(f*x)^3*tan(e)^3 + 144*B*c^2*d*f*x*tan(f*x)^3*tan(e)^3 + 144*A*c*d^2*f*x*tan(f*x)^3*tan(e)^3 - 144*C*c*d^2*f
*x*tan(f*x)^3*tan(e)^3 - 48*B*d^3*f*x*tan(f*x)^3*tan(e)^3 + 18*C*c^2*d*tan(f*x)^4*tan(e)^4 + 18*B*c*d^2*tan(f*
x)^4*tan(e)^4 + 6*A*d^3*tan(f*x)^4*tan(e)^4 - 9*C*d^3*tan(f*x)^4*tan(e)^4 + 24*B*c^3*log(4*(tan(f*x)^4*tan(e)^
2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^3
*tan(e)^3 + 72*A*c^2*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2
*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^3*tan(e)^3 - 72*C*c^2*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)
^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^3*tan(e)^3 - 72
*B*c*d^2*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(
e) + 1)/(tan(e)^2 + 1))*tan(f*x)^3*tan(e)^3 - 24*A*d^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(
f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^3*tan(e)^3 + 24*C*d^3*log(4*(ta
n(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2
+ 1))*tan(f*x)^3*tan(e)^3 - 12*C*c^3*tan(f*x)^4*tan(e)^3 - 36*B*c^2*d*tan(f*x)^4*tan(e)^3 - 36*A*c*d^2*tan(f*x
)^4*tan(e)^3 + 36*C*c*d^2*tan(f*x)^4*tan(e)^3 + 12*B*d^3*tan(f*x)^4*tan(e)^3 - 12*C*c^3*tan(f*x)^3*tan(e)^4 -
36*B*c^2*d*tan(f*x)^3*tan(e)^4 - 36*A*c*d^2*tan(f*x)^3*tan(e)^4 + 36*C*c*d^2*tan(f*x)^3*tan(e)^4 + 12*B*d^3*ta
n(f*x)^3*tan(e)^4 + 72*A*c^3*f*x*tan(f*x)^2*tan(e)^2 - 72*C*c^3*f*x*tan(f*x)^2*tan(e)^2 - 216*B*c^2*d*f*x*tan(
f*x)^2*tan(e)^2 - 216*A*c*d^2*f*x*tan(f*x)^2*tan(e)^2 + 216*C*c*d^2*f*x*tan(f*x)^2*tan(e)^2 + 72*B*d^3*f*x*tan
(f*x)^2*tan(e)^2 + 18*C*c^2*d*tan(f*x)^4*tan(e)^2 + 18*B*c*d^2*tan(f*x)^4*tan(e)^2 + 6*A*d^3*tan(f*x)^4*tan(e)
^2 - 6*C*d^3*tan(f*x)^4*tan(e)^2 - 36*C*c^2*d*tan(f*x)^3*tan(e)^3 - 36*B*c*d^2*tan(f*x)^3*tan(e)^3 - 12*A*d^3*
tan(f*x)^3*tan(e)^3 + 24*C*d^3*tan(f*x)^3*tan(e)^3 + 18*C*c^2*d*tan(f*x)^2*tan(e)^4 + 18*B*c*d^2*tan(f*x)^2*ta
n(e)^4 + 6*A*d^3*tan(f*x)^2*tan(e)^4 - 6*C*d^3*tan(f*x)^2*tan(e)^4 - 12*C*c*d^2*tan(f*x)^4*tan(e) - 4*B*d^3*ta
n(f*x)^4*tan(e) - 36*B*c^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2
- 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^2*tan(e)^2 - 108*A*c^2*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan
(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^2*tan(e)^2
+ 108*C*c^2*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x
)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^2*tan(e)^2 + 108*B*c*d^2*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(
e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^2*tan(e)^2 + 36*A*d^3*
log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(
tan(e)^2 + 1))*tan(f*x)^2*tan(e)^2 - 36*C*d^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*ta
n(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)^2*tan(e)^2 + 36*C*c^3*tan(f*x)^3*tan(e)^
2 + 108*B*c^2*d*tan(f*x)^3*tan(e)^2 + 108*A*c*d^2*tan(f*x)^3*tan(e)^2 - 144*C*c*d^2*tan(f*x)^3*tan(e)^2 - 48*B
*d^3*tan(f*x)^3*tan(e)^2 + 36*C*c^3*tan(f*x)^2*tan(e)^3 + 108*B*c^2*d*tan(f*x)^2*tan(e)^3 + 108*A*c*d^2*tan(f*
x)^2*tan(e)^3 - 144*C*c*d^2*tan(f*x)^2*tan(e)^3 - 48*B*d^3*tan(f*x)^2*tan(e)^3 - 12*C*c*d^2*tan(f*x)*tan(e)^4
- 4*B*d^3*tan(f*x)*tan(e)^4 + 3*C*d^3*tan(f*x)^4 - 48*A*c^3*f*x*tan(f*x)*tan(e) + 48*C*c^3*f*x*tan(f*x)*tan(e)
+ 144*B*c^2*d*f*x*tan(f*x)*tan(e) + 144*A*c*d^2*f*x*tan(f*x)*tan(e) - 144*C*c*d^2*f*x*tan(f*x)*tan(e) - 48*B*
d^3*f*x*tan(f*x)*tan(e) - 36*C*c^2*d*tan(f*x)^3*tan(e) - 36*B*c*d^2*tan(f*x)^3*tan(e) - 12*A*d^3*tan(f*x)^3*ta
n(e) + 24*C*d^3*tan(f*x)^3*tan(e) + 36*C*c^2*d*tan(f*x)^2*tan(e)^2 + 36*B*c*d^2*tan(f*x)^2*tan(e)^2 + 12*A*d^3
*tan(f*x)^2*tan(e)^2 - 12*C*d^3*tan(f*x)^2*tan(e)^2 - 36*C*c^2*d*tan(f*x)*tan(e)^3 - 36*B*c*d^2*tan(f*x)*tan(e
)^3 - 12*A*d^3*tan(f*x)*tan(e)^3 + 24*C*d^3*tan(f*x)*tan(e)^3 + 3*C*d^3*tan(e)^4 + 12*C*c*d^2*tan(f*x)^3 + 4*B
*d^3*tan(f*x)^3 + 24*B*c^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2
- 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)*tan(e) + 72*A*c^2*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)
^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)*tan(e) - 72*C*c
^2*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) +
1)/(tan(e)^2 + 1))*tan(f*x)*tan(e) - 72*B*c*d^2*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2
*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)*tan(e) - 24*A*d^3*log(4*(tan(f*x)^4*t
an(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(
f*x)*tan(e) + 24*C*d^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2
*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1))*tan(f*x)*tan(e) - 36*C*c^3*tan(f*x)^2*tan(e) - 108*B*c^2*d*tan(f*x)^2*ta
n(e) - 108*A*c*d^2*tan(f*x)^2*tan(e) + 144*C*c*d^2*tan(f*x)^2*tan(e) + 48*B*d^3*tan(f*x)^2*tan(e) - 36*C*c^3*t
an(f*x)*tan(e)^2 - 108*B*c^2*d*tan(f*x)*tan(e)^2 - 108*A*c*d^2*tan(f*x)*tan(e)^2 + 144*C*c*d^2*tan(f*x)*tan(e)
^2 + 48*B*d^3*tan(f*x)*tan(e)^2 + 12*C*c*d^2*tan(e)^3 + 4*B*d^3*tan(e)^3 + 12*A*c^3*f*x - 12*C*c^3*f*x - 36*B*
c^2*d*f*x - 36*A*c*d^2*f*x + 36*C*c*d^2*f*x + 12*B*d^3*f*x + 18*C*c^2*d*tan(f*x)^2 + 18*B*c*d^2*tan(f*x)^2 + 6
*A*d^3*tan(f*x)^2 - 6*C*d^3*tan(f*x)^2 - 36*C*c^2*d*tan(f*x)*tan(e) - 36*B*c*d^2*tan(f*x)*tan(e) - 12*A*d^3*ta
n(f*x)*tan(e) + 24*C*d^3*tan(f*x)*tan(e) + 18*C*c^2*d*tan(e)^2 + 18*B*c*d^2*tan(e)^2 + 6*A*d^3*tan(e)^2 - 6*C*
d^3*tan(e)^2 - 6*B*c^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2
*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1)) - 18*A*c^2*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)
^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1)) + 18*C*c^2*d*log(4*(tan(f*x)^4*tan(e)^2 - 2*
tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1)) + 18*B*c*d^2*log
(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan
(e)^2 + 1)) + 6*A*d^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*
tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1)) - 6*C*d^3*log(4*(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*t
an(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)/(tan(e)^2 + 1)) + 12*C*c^3*tan(f*x) + 36*B*c^2*d*tan(f*x) + 36*A
*c*d^2*tan(f*x) - 36*C*c*d^2*tan(f*x) - 12*B*d^3*tan(f*x) + 12*C*c^3*tan(e) + 36*B*c^2*d*tan(e) + 36*A*c*d^2*t
an(e) - 36*C*c*d^2*tan(e) - 12*B*d^3*tan(e) + 18*C*c^2*d + 18*B*c*d^2 + 6*A*d^3 - 9*C*d^3)/(f*tan(f*x)^4*tan(e
)^4 - 4*f*tan(f*x)^3*tan(e)^3 + 6*f*tan(f*x)^2*tan(e)^2 - 4*f*tan(f*x)*tan(e) + f)
________________________________________________________________________________________
maple [B] time = 0.03, size = 420, normalized size = 2.20 \[ \frac {C \,d^{3} \left (\tan ^{4}\left (f x +e \right )\right )}{4 f}+\frac {B \left (\tan ^{3}\left (f x +e \right )\right ) d^{3}}{3 f}+\frac {C \left (\tan ^{3}\left (f x +e \right )\right ) c \,d^{2}}{f}+\frac {A \left (\tan ^{2}\left (f x +e \right )\right ) d^{3}}{2 f}+\frac {3 B \left (\tan ^{2}\left (f x +e \right )\right ) c \,d^{2}}{2 f}+\frac {3 C \left (\tan ^{2}\left (f x +e \right )\right ) c^{2} d}{2 f}-\frac {C \left (\tan ^{2}\left (f x +e \right )\right ) d^{3}}{2 f}+\frac {3 A c \,d^{2} \tan \left (f x +e \right )}{f}+\frac {3 B \,c^{2} d \tan \left (f x +e \right )}{f}-\frac {B \,d^{3} \tan \left (f x +e \right )}{f}+\frac {c^{3} C \tan \left (f x +e \right )}{f}-\frac {3 c C \,d^{2} \tan \left (f x +e \right )}{f}+\frac {3 \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) A \,c^{2} d}{2 f}-\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) A \,d^{3}}{2 f}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) B \,c^{3}}{2 f}-\frac {3 \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) B c \,d^{2}}{2 f}-\frac {3 \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) C \,c^{2} d}{2 f}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) C \,d^{3}}{2 f}+\frac {A \arctan \left (\tan \left (f x +e \right )\right ) c^{3}}{f}-\frac {3 A \arctan \left (\tan \left (f x +e \right )\right ) c \,d^{2}}{f}-\frac {3 B \arctan \left (\tan \left (f x +e \right )\right ) c^{2} d}{f}+\frac {B \arctan \left (\tan \left (f x +e \right )\right ) d^{3}}{f}-\frac {C \arctan \left (\tan \left (f x +e \right )\right ) c^{3}}{f}+\frac {3 C \arctan \left (\tan \left (f x +e \right )\right ) c \,d^{2}}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
int((c+d*tan(f*x+e))^3*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x)
[Out]
1/4/f*C*d^3*tan(f*x+e)^4+1/3/f*B*tan(f*x+e)^3*d^3+1/f*C*tan(f*x+e)^3*c*d^2+1/2/f*A*tan(f*x+e)^2*d^3+3/2/f*B*ta
n(f*x+e)^2*c*d^2+3/2/f*C*tan(f*x+e)^2*c^2*d-1/2/f*C*tan(f*x+e)^2*d^3+3/f*A*c*d^2*tan(f*x+e)+3/f*B*c^2*d*tan(f*
x+e)-1/f*B*d^3*tan(f*x+e)+1/f*c^3*C*tan(f*x+e)-3/f*c*C*d^2*tan(f*x+e)+3/2/f*ln(1+tan(f*x+e)^2)*A*c^2*d-1/2/f*l
n(1+tan(f*x+e)^2)*A*d^3+1/2/f*ln(1+tan(f*x+e)^2)*B*c^3-3/2/f*ln(1+tan(f*x+e)^2)*B*c*d^2-3/2/f*ln(1+tan(f*x+e)^
2)*C*c^2*d+1/2/f*ln(1+tan(f*x+e)^2)*C*d^3+1/f*A*arctan(tan(f*x+e))*c^3-3/f*A*arctan(tan(f*x+e))*c*d^2-3/f*B*ar
ctan(tan(f*x+e))*c^2*d+1/f*B*arctan(tan(f*x+e))*d^3-1/f*C*arctan(tan(f*x+e))*c^3+3/f*C*arctan(tan(f*x+e))*c*d^
2
________________________________________________________________________________________
maxima [A] time = 0.58, size = 202, normalized size = 1.06 \[ \frac {3 \, C d^{3} \tan \left (f x + e\right )^{4} + 4 \, {\left (3 \, C c d^{2} + B d^{3}\right )} \tan \left (f x + e\right )^{3} + 6 \, {\left (3 \, C c^{2} d + 3 \, B c d^{2} + {\left (A - C\right )} d^{3}\right )} \tan \left (f x + e\right )^{2} + 12 \, {\left ({\left (A - C\right )} c^{3} - 3 \, B c^{2} d - 3 \, {\left (A - C\right )} c d^{2} + B d^{3}\right )} {\left (f x + e\right )} + 6 \, {\left (B c^{3} + 3 \, {\left (A - C\right )} c^{2} d - 3 \, B c d^{2} - {\left (A - C\right )} d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 12 \, {\left (C c^{3} + 3 \, B c^{2} d + 3 \, {\left (A - C\right )} c d^{2} - B d^{3}\right )} \tan \left (f x + e\right )}{12 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((c+d*tan(f*x+e))^3*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="maxima")
[Out]
1/12*(3*C*d^3*tan(f*x + e)^4 + 4*(3*C*c*d^2 + B*d^3)*tan(f*x + e)^3 + 6*(3*C*c^2*d + 3*B*c*d^2 + (A - C)*d^3)*
tan(f*x + e)^2 + 12*((A - C)*c^3 - 3*B*c^2*d - 3*(A - C)*c*d^2 + B*d^3)*(f*x + e) + 6*(B*c^3 + 3*(A - C)*c^2*d
- 3*B*c*d^2 - (A - C)*d^3)*log(tan(f*x + e)^2 + 1) + 12*(C*c^3 + 3*B*c^2*d + 3*(A - C)*c*d^2 - B*d^3)*tan(f*x
+ e))/f
________________________________________________________________________________________
mupad [B] time = 8.79, size = 221, normalized size = 1.16 \[ x\,\left (A\,c^3+B\,d^3-C\,c^3-3\,A\,c\,d^2-3\,B\,c^2\,d+3\,C\,c\,d^2\right )+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (C\,c^3-B\,d^3+3\,A\,c\,d^2+3\,B\,c^2\,d-3\,C\,c\,d^2\right )}{f}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (\frac {B\,d^3}{3}+C\,c\,d^2\right )}{f}-\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )\,\left (\frac {A\,d^3}{2}-\frac {B\,c^3}{2}-\frac {C\,d^3}{2}-\frac {3\,A\,c^2\,d}{2}+\frac {3\,B\,c\,d^2}{2}+\frac {3\,C\,c^2\,d}{2}\right )}{f}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {A\,d^3}{2}-\frac {C\,d^3}{2}+\frac {3\,B\,c\,d^2}{2}+\frac {3\,C\,c^2\,d}{2}\right )}{f}+\frac {C\,d^3\,{\mathrm {tan}\left (e+f\,x\right )}^4}{4\,f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
int((c + d*tan(e + f*x))^3*(A + B*tan(e + f*x) + C*tan(e + f*x)^2),x)
[Out]
x*(A*c^3 + B*d^3 - C*c^3 - 3*A*c*d^2 - 3*B*c^2*d + 3*C*c*d^2) + (tan(e + f*x)*(C*c^3 - B*d^3 + 3*A*c*d^2 + 3*B
*c^2*d - 3*C*c*d^2))/f + (tan(e + f*x)^3*((B*d^3)/3 + C*c*d^2))/f - (log(tan(e + f*x)^2 + 1)*((A*d^3)/2 - (B*c
^3)/2 - (C*d^3)/2 - (3*A*c^2*d)/2 + (3*B*c*d^2)/2 + (3*C*c^2*d)/2))/f + (tan(e + f*x)^2*((A*d^3)/2 - (C*d^3)/2
+ (3*B*c*d^2)/2 + (3*C*c^2*d)/2))/f + (C*d^3*tan(e + f*x)^4)/(4*f)
________________________________________________________________________________________
sympy [A] time = 0.76, size = 410, normalized size = 2.15 \[ \begin {cases} A c^{3} x + \frac {3 A c^{2} d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - 3 A c d^{2} x + \frac {3 A c d^{2} \tan {\left (e + f x \right )}}{f} - \frac {A d^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {A d^{3} \tan ^{2}{\left (e + f x \right )}}{2 f} + \frac {B c^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - 3 B c^{2} d x + \frac {3 B c^{2} d \tan {\left (e + f x \right )}}{f} - \frac {3 B c d^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {3 B c d^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} + B d^{3} x + \frac {B d^{3} \tan ^{3}{\left (e + f x \right )}}{3 f} - \frac {B d^{3} \tan {\left (e + f x \right )}}{f} - C c^{3} x + \frac {C c^{3} \tan {\left (e + f x \right )}}{f} - \frac {3 C c^{2} d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {3 C c^{2} d \tan ^{2}{\left (e + f x \right )}}{2 f} + 3 C c d^{2} x + \frac {C c d^{2} \tan ^{3}{\left (e + f x \right )}}{f} - \frac {3 C c d^{2} \tan {\left (e + f x \right )}}{f} + \frac {C d^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {C d^{3} \tan ^{4}{\left (e + f x \right )}}{4 f} - \frac {C d^{3} \tan ^{2}{\left (e + f x \right )}}{2 f} & \text {for}\: f \neq 0 \\x \left (c + d \tan {\relax (e )}\right )^{3} \left (A + B \tan {\relax (e )} + C \tan ^{2}{\relax (e )}\right ) & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((c+d*tan(f*x+e))**3*(A+B*tan(f*x+e)+C*tan(f*x+e)**2),x)
[Out]
Piecewise((A*c**3*x + 3*A*c**2*d*log(tan(e + f*x)**2 + 1)/(2*f) - 3*A*c*d**2*x + 3*A*c*d**2*tan(e + f*x)/f - A
*d**3*log(tan(e + f*x)**2 + 1)/(2*f) + A*d**3*tan(e + f*x)**2/(2*f) + B*c**3*log(tan(e + f*x)**2 + 1)/(2*f) -
3*B*c**2*d*x + 3*B*c**2*d*tan(e + f*x)/f - 3*B*c*d**2*log(tan(e + f*x)**2 + 1)/(2*f) + 3*B*c*d**2*tan(e + f*x)
**2/(2*f) + B*d**3*x + B*d**3*tan(e + f*x)**3/(3*f) - B*d**3*tan(e + f*x)/f - C*c**3*x + C*c**3*tan(e + f*x)/f
- 3*C*c**2*d*log(tan(e + f*x)**2 + 1)/(2*f) + 3*C*c**2*d*tan(e + f*x)**2/(2*f) + 3*C*c*d**2*x + C*c*d**2*tan(
e + f*x)**3/f - 3*C*c*d**2*tan(e + f*x)/f + C*d**3*log(tan(e + f*x)**2 + 1)/(2*f) + C*d**3*tan(e + f*x)**4/(4*
f) - C*d**3*tan(e + f*x)**2/(2*f), Ne(f, 0)), (x*(c + d*tan(e))**3*(A + B*tan(e) + C*tan(e)**2), True))
________________________________________________________________________________________